(function(){
    _$(document).ready(function(){
        function App(){};
        App.prototype.ajaxFn=function(){
            _$.post('/getmaleCate',function(data){
                if(data['code']==1){
                    var cg=data['info']['cg'];
                    var subc=data['info']['subc'];
                    var counts=data['info']['counts'];
                    for(var i=0;i<cg.length;i++){
                        cg[i]['subcate']=subc[i];
                        cg[i].count=counts[i];
                    }
                    for(var val in cg){
                        if(val==cg.length-1){
                            break;
                        }
                        var html = template('tpl', cg[val]);
                        _$("#sortul").append(html);
                    }
                }
            });
        };
        App.prototype.eventFn=function(){

        };
        App.prototype.init=function(){
            //事件调用
            this.ajaxFn();
            this.eventFn();
        };
        //程序初始化
        new App().init();
    })
})();